#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>
int main()
{
	int lenght = 0;
	int x=0;
	int j = 0;
	char a[20] = { 0 };
	char b[10][20] = {0};
	int count = 0;
	gets(a);
	lenght=strlen(a);
	for (int i = 0; i < lenght; i++)
	{
		if ((a[i] >= 'a' && a[i] <= 'z')&&(a[i + 1] == ' '|| a[i + 1] == '\0'))
				count++;
	}
	printf("%d\n", count);
	for (int i = 0; i < lenght; i++)
	{
		if (a[i] >= 'a' && a[i] <= 'z')
		{
			b[count - 1][j] = a[i];
			j++;
			if (a[i + 1] == ' ' || a[i + 1] == '\0')
			{
				b[count - 1][j] = ' ';
				count--;
				j = 0;
			}
		}
	}
	//for (int x = 0; x < count; x++)
	 printf("%s", b[0]);
	 printf("%s", b[1]);
	 printf("%s", b[2]);
	 printf("%s", b[3]);

}